function [] = makeops(main_dir, int_format);

% MAKEOPS - compiles overloaded operators for integer classes
%
%    MAKEOPS(DIR, FORMAT) compiles source code located in the
%    directory DIR to be used as the overloaded operators for
%    the integer class FORMAT ('uint8', 'int32', etc.).
%
%    The directory DIR should contain the subdirectories
%    @<FORMAT> & @<FORMAT>\SOURCE.  For example, if DIR is
%    'c:\matlab\work' and FORMAT is 'uint32', then the source
%    code should be found in 'c:\matlab\work\@uint32\source'
%    and the DLLs for the overloaded operators will be moved
%    to 'c:\matlab\work\@uint32' after compilation.

% By:   S.C. Molitor (smolitor@med.unc.edu)
% Date: January 4, 2000

% change to the source code directory

curr_dir = pwd;
cd([main_dir '\@' int_format '\source']);

% compile logical operators

mex and.c uintutil.c
mex or.c uintutil.c
mex not.c uintutil.c

% compile relational operators

mex lt.c uintutil.c
mex gt.c uintutil.c
mex le.c uintutil.c
mex ge.c uintutil.c
mex eq.c uintutil.c
mex ne.c uintutil.c

% compile arithmetic operators

mex plus.c uintutil.c
mex minus.c uintutil.c
mex times.c uintutil.c
mex rdivide.c uintutil.c
mex mtimes.c uintutil.c
mex mrdivide.c uintutil.c
mex power.c uintutil.c

% compile rounding functions

mex ceil.c uintutil.c
mex floor.c uintutil.c
mex round.c uintutil.c

% compile miscellaneous operators

mex min.c uintutil.c
mex max.c uintutil.c
mex mean.c uintutil.c
mex sum.c uintutil.c
mex diff.c uintutil.c
mex sort.c uintutil.c

% move DLLs to appropriate location

!move *.dll ..
cd(curr_dir);
